package com.example.user.dao.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "user")
public class User
{
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    @TableField(value = "is_active")
    private boolean isActive;
    private String email;
    private String password;
    @TableField(value = "created_time")
    private Date createdTime;
    @TableField(value = "updated_time")
    private Date updatedTime;

    @TableLogic
    private boolean deleted;
}

//CREATE TABLE `user` (
//    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '用户ID',
//    `is_active` TINYINT(1) NOT NULL DEFAULT 1 COMMENT '启用状态',
//    `email` VARCHAR(255) NOT NULL COMMENT '邮箱',
//    `password` VARCHAR(255) NOT NULL COMMENT '密码',
//    `created_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
//    `updated_time` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
//    `deleted` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除标记',
//    PRIMARY KEY (`id`),
//    UNIQUE KEY `uniq_email` (`email`),
//    INDEX `idx_role` (`role`)
//    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户信息表';